package com.fanbuchi.app.ins.api;

import com.fanbuchi.app.ins.BuildConfig;
import com.fanbuchi.app.ins.manager.OkHttpManager;

import retrofit.JacksonConverterFactory;
import retrofit.Retrofit;
import retrofit.RxJavaCallAdapterFactory;

/**
 * Created by rabbit on 2016/3/19.
 */
public interface API {

    /*builder.setClient(new OkClient(OkHttpUtils.getInstance(context)));
    builder.setLogLevel(
    Config.DEBUG ? RestAdapter.LogLevel.FULL : RestAdapter.LogLevel.NONE);
    */
    String ENDPOINT = BuildConfig.protocol+BuildConfig.domain+":"+BuildConfig.port;
    //client.interceptors().add(..);
    //.setClient(new OkClient(mOkHttpClient))
    Retrofit retrofit = new Retrofit.Builder()
            .baseUrl(ENDPOINT)
            .client(OkHttpManager.getmOkHttpClient())

            //.addConverterFactory(ProtoConverterFactory.create())
            .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
            .addConverterFactory(JacksonConverterFactory.create())

            .validateEagerly()
            .build();

}
